﻿@model TidyBlog.MVC.WWW.Models.Paginator

@if (Model.TotalPages > 1)
{
<ol class="paginator">
	@if (Model.CurrentPage > 1)
	{
	<li class="paginator-item paginator-prev"><a href="@Model.GenerateHref(Model.CurrentPage - 1)">上一页</a></li>
	}
	else
	{
	<li class="paginator-item paginator-prev paginator-prev-disabled"><span>上一页</span></li>
	}
	@foreach (var obj in Model.Items)
	{
		if (obj.IsCurrent)
		{
	<li class="paginator-item paginator-number paginator-current"><span>@obj.Number</span></li>
		}
		else if (obj.Number == -1)
		{
	<li class="paginator-item paginator-ellipsis"><span>...</span></li>
		}
		else
		{
	<li class="paginator-item paginator-number"><a href="@Model.GenerateHref(obj.Number)">@obj.Number</a></li>		
		}
	}
	@if (Model.CurrentPage < Model.TotalPages)
	{
	<li class="paginator-item paginator-next"><a href="@Model.GenerateHref(Model.CurrentPage + 1)">下一页</a></li>
	}
	else
	{
	<li class="paginator-item paginator-next paginator-next-disabled"><span>下一页</span></li>
	}
</ol>
}